execute store result score #index temp run data get entity @s item.components."minecraft:custom_data".hubMenu.index
execute store result entity @s item.components."minecraft:custom_data".hubMenu.index int 1 run scoreboard players add #index temp 1

#test是否存在元素
execute store result score #success temp run function vs:system/hub/menu/gamerule_settings/test/index_exist with entity @s item.components."minecraft:custom_data".hubMenu

execute if score #success temp matches 1 run function vs:system/hub/menu/gamerule_settings/read with entity @s item.components."minecraft:custom_data".hubMenu
execute if score #success temp matches 0 run function vs:system/hub/menu/gamerule_settings/read {index:0}


scoreboard players reset #index temp
scoreboard players reset #success temp

playsound block.dispenser.fail master @p[tag=inconfig] ~ ~ ~ 1.0